from queue import Full
import pandas as pd
import os

list = [
    {
        "id": "1694192762968084482",
        "kgid": "1694192763278462978",
        "desc": "进化与发展心理学交叉专业课程：人类乐感演变下择偶和交友动机的发展变化",
        "enzhuti": "Evolutionary Psychology",
        "url": "1",
        "starttime": "2024-05-31",
        "enrollmentstatus": 1,
        "banner": "1788124366400126976",
        "teachername": "Max Krasnow",
        "teacherschool_en": "Harvard University",
        "teacherschool_cn": "哈佛大学",
        "majorsName": "发展心理学/人格心理学/社会心理学",
        "xid": 4,
        "standardCode": "P0121",
        "xidName": 1,
        "direction": "心理学",
        "difficulty": 2.0,
        "endtime": "2024-07-07",
        "classCode": "0001",
        "sort": 4,
        "isThesis": 0,
        "keywords": "进化心理学|社会学|发展心理学|人类学|生态学|行为心理学|人格心理学|认知心理学|音乐心理学",
        "courseCity": Full,
        "beginTimeOnline": "2024-05-31",
        "endTimeOnline": "2024-07-07",
        "beginTimeOffline": Full,
        "endTimeOffline": Full,
        "posterList": [
            {"resourceId": "1791375159374905344", "majorType": "3", "id": Full}
        ],
        "productPackage": Full,
        "coursePhase": 5,
        "courseCode": "CO003211",
        "code": "SY004355",
        "teachMode": Full,
        "teachSimpleTime": Full,
        "teachFullTime": "05/25-07/12",
        "coursePhase2": 3,
        "professorPosition": "哈佛大学终身教授",
        "writerStartTime": "2024-05-25",
        "lectureStartTime": "2024-07-01",
        "researchStartTime": "2024-05-31",
        "paperStartTime": "2024-07-10",
    }
]
fileName = "test"
result_df = pd.DataFrame()
for item in range(1, 10):
    result_df = pd.concat([result_df, pd.DataFrame(list)])


def save():
    path = os.path.join(os.path.dirname(__file__), "output", f"{fileName}.xlsx")
    result_df.to_excel(path, index=False)  # 输出总的结果
    print("下载完成")


save()
